package com.suray.wcs.service.plc;

import com.suray.basic.wcs.plc.utils.LifterLayerType;
import com.suray.basic.wcs.plc.utils.LifterLocationType;
import lombok.Data;

import java.util.Objects;

/**
 * 提升机位置
 */
@Data
public class LifterLocationInfo {
    private LifterLayerType layerType;
    private int layer;
    private LifterLocationType twoCarLocation;

    public LifterLocationInfo(int layer, LifterLayerType layerType, LifterLocationType twoCarLocation) {
        this.layer = layer;
        this.layerType = layerType;
        this.twoCarLocation = twoCarLocation;
    }

    public LifterLocationInfo(LifterLocationInfo lifterLocationInfo) {
        this.layer = lifterLocationInfo.layer;
        this.layerType = lifterLocationInfo.layerType;
        this.twoCarLocation = lifterLocationInfo.twoCarLocation;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LifterLocationInfo that = (LifterLocationInfo) o;
        return layer == that.layer &&
                layerType == that.layerType &&
                twoCarLocation == that.twoCarLocation;
    }

    @Override
    public int hashCode() {
        return Objects.hash(layerType, layer, twoCarLocation);
    }

    @Override
    public String toString() {
        return "{" +
                "层类型->" + layerType +
                ", 几层->" + layer +
                ", 两向车位置->" + twoCarLocation +
                '}';
    }
}
